<!-- 忘记密码 -->
{include file="head" /}

<style>
    .forget{
        height: auto;
        margin: 30px auto;
        width: 90%;
    }

    .forget .l_input {
        line-height: 34px;
        background: none;
        margin-bottom: 12px;
        color: #fff;
        font-size: 14px;
        width: 100%;
        text-indent: 10px;
        border: none;
        border-bottom: 1px solid #054060;
        outline: none;
    }

    .forget .input_bg {
        height: 45px;
        background: none;
        margin-bottom: 14px;
        border: none;
        width: 100%;
        border-bottom: 1px solid #054060;
    }

    .forget .input_bg .verify-code {
        width: 70%;
        line-height: 34px;
        background: none;
        color: #fff;
        font-size: 14px;
        text-indent: 10px;
        border: none;
        float: left;
        border: none;
        outline: none;
    }

    .forget .get-verify {
        width: 30%;
        float: left;
        line-height: 30px;
        text-align: center;
        background: #00a0e9;
        font-size: 16px;
        color: #fff;
        cursor: pointer;
        border: none;
        border-radius: 2px;
    }

    .forget .l_btn {
        width: 100%;
        height: 50px;
        background: #eb8327;
        margin: 35px auto 20px;
        border-radius: 2px;
    }

    .forget .l_btn .sub {
        line-height: 50px;
        color: #fff;
        background: none;
        width: 100%;
        border: none;
        font-size: 18px;
        height: 50px;
        cursor: pointer;
        outline: none;
        border-radius: 2px;
    }
</style>


<body>
<div class="forget">
    <form name="formid" id="formid" method="post">
        <input type="text" class="username l_input" name="username" required="" placeholder="手机号码">

        <div class="input_bg">
            <input type="text" name="phonecode" placeholder="短信验证码" class="phonecode verify-code" maxlength="4" id="vertify">

            <input type="button" onclick ="return get_svg();" value="获取验证码" id="code_btn" class="get-verify">
        </div>

        <input type="password" name="upwd" required="" class="l_input" placeholder="新密码">

        <input type="password" name="upwd2" required="" data-password="password" class="l_input" placeholder="确认密码">

    </form>

    <div class="l_btn">
        <button type="button" class="sub" onclick="return resetform(this.form);">重置密码</button>
    </div>
</div>
<script src="/static/layer/layer.js"></script>
<!-- 公共函数 -->
<script src="/static/public/js/function.js"></script>
<script src="/static/public/js/base64.js"></script>
<script type="text/javascript">
    var Base64 = new Base64();


</script>
<script src="__HOME__/js/lk/user.js"></script>
<script>
    function resetform(form){
        var username = form.username.value;
        var upwd = form.upwd.value;
        var upwd2 = form.upwd2.value;
        if(!username){
            layer.msg('请输入手机号');
            return false;
        }

        if (!upwd) {
            layer.msg('请输入登录密码');
            return false;
        }

        if (!upwd2) {
            layer.msg('请再次输入登录密码');
            return false;
        }

        if(upwd.length < 6 || upwd2.length < 6){
            layer.msg('密码长度大于6位');
            return false;
        }

        if(upwd != upwd2){
            layer.msg('两次输入密码不同');
            return false;
        }


        var data = $('#formid').serialize();

        // TODO
        var formurl = "{:Url('login/respass')}";
        var locurl = "{:Url('index/user/index')}";
        console.log(formurl)
        WPpost(formurl,data,locurl);
        return false;
    }
</script>

</body>

